home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{4061E361-3C46-11D2-AE66-D8A64094D131}#1.0#0"; "SNAILTIMECALC.DLL"
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Snail CalcDate Demo"
- ClientHeight = 3525
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 6840
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 3525
- ScaleWidth = 6840
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton cmdTimeMeth1
- Caption = "Time Methods"
- Height = 375
- Left = 1440
- TabIndex = 26
- Top = 120
- Width = 1215
- End
- Begin VB.CommandButton cmdDateMeth1
- Caption = "Date Methods"
- Height = 375
- Left = 120
- TabIndex = 24
- Top = 120
- Width = 1215
- End
- Begin VB.PictureBox picDateMeth1
- Height = 2775
- Left = 120
- ScaleHeight = 2715
- ScaleWidth = 6555
- TabIndex = 0
- Top = 600
- Width = 6615
- Begin VB.Frame fra_DatePlusDays
- Caption = "Method DatePlusDays"
- Height = 735
- Left = 120
- TabIndex = 16
- Top = 120
- Width = 6255
- Begin VB.TextBox txtDateForDatePlusDays
- Height = 285
- Left = 840
- TabIndex = 20
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtDaysForDatePlusDays
- Height = 285
- Left = 2400
- TabIndex = 19
- Text = "Text1"
- Top = 240
- Width = 630
- End
- Begin VB.CommandButton cmdDatePlusDays
- Caption = "Do"
- Height = 375
- Left = 3480
- TabIndex = 18
- Top = 240
- Width = 495
- End
- Begin VB.TextBox txtResultDateForDatePlusDays
- Height = 285
- Left = 4680
- TabIndex = 17
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.Label Label1
- Caption = "Date:"
- Height = 255
- Left = 240
- TabIndex = 23
- Top = 240
- Width = 495
- End
- Begin VB.Label Label2
- Caption = "Days:"
- Height = 255
- Left = 1800
- TabIndex = 22
- Top = 240
- Width = 495
- End
- Begin VB.Label Label3
- Caption = "Result:"
- Height = 255
- Left = 4080
- TabIndex = 21
- Top = 240
- Width = 615
- End
- End
- Begin VB.Frame fra_DaysBetweenDates
- Caption = "Method DaysBetweenDates"
- Height = 735
- Left = 120
- TabIndex = 8
- Top = 960
- Width = 6255
- Begin VB.TextBox txtDateForDaysBetweenDays1
- Height = 285
- Left = 840
- TabIndex = 12
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtDateForDaysBetweenDays2
- Height = 285
- Left = 2400
- TabIndex = 11
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtResultDays
- Height = 285
- Left = 4680
- TabIndex = 10
- Text = "Text1"
- Top = 240
- Width = 735
- End
- Begin VB.CommandButton cmdDaysBetweenDates
- Caption = "Do"
- Height = 375
- Left = 3480
- TabIndex = 9
- Top = 240
- Width = 495
- End
- Begin VB.Label Label4
- Caption = "Date1:"
- Height = 255
- Left = 240
- TabIndex = 15
- Top = 240
- Width = 615
- End
- Begin VB.Label Label5
- Caption = "Date 2:"
- Height = 255
- Left = 1800
- TabIndex = 14
- Top = 240
- Width = 615
- End
- Begin VB.Label Label6
- Caption = "Result:"
- Height = 255
- Left = 4080
- TabIndex = 13
- Top = 240
- Width = 615
- End
- End
- Begin VB.Frame fra_DayOfWeek
- Caption = "Method DayOfWeek"
- Height = 735
- Left = 120
- TabIndex = 1
- Top = 1800
- Width = 6255
- Begin VB.CommandButton cmdDayOfWeek
- Caption = "Do"
- Height = 375
- Left = 3480
- TabIndex = 5
- Top = 240
- Width = 495
- End
- Begin VB.TextBox txtDayOfWeekNumber
- Height = 285
- Left = 4680
- TabIndex = 4
- Text = "Text1"
- Top = 240
- Width = 375
- End
- Begin VB.TextBox txtDateForDayOfWeek
- Height = 285
- Left = 840
- TabIndex = 3
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtDayOfWeekVerbose
- Height = 285
- Left = 5160
- TabIndex = 2
- Text = "Text1"
- Top = 240
- Width = 975
- End
- Begin VB.Label Label7
- Caption = "Result:"
- Height = 255
- Left = 4080
- TabIndex = 7
- Top = 240
- Width = 615
- End
- Begin VB.Label Label8
- Caption = "Date:"
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 240
- Width = 615
- End
- End
- End
- Begin VB.PictureBox picTimeMeth1
- Height = 2775
- Left = 120
- ScaleHeight = 2715
- ScaleWidth = 6555
- TabIndex = 25
- Top = 600
- Width = 6615
- Begin VB.Frame fraTimeMinusTime
- Caption = "Method TimeMinusTime"
- Height = 735
- Left = 120
- TabIndex = 35
- Top = 960
- Width = 6255
- Begin VB.TextBox txtTimeForTimeMinusTime1
- Height = 285
- Left = 720
- TabIndex = 39
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtTimeForTimeMinusTime2
- Height = 285
- Left = 2400
- TabIndex = 38
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtTimeMinusTimeResult
- Height = 285
- Left = 4680
- TabIndex = 37
- Text = "Text1"
- Top = 240
- Width = 735
- End
- Begin VB.CommandButton cmdTimeMinusTime
- Caption = "Do"
- Height = 375
- Left = 3480
- TabIndex = 36
- Top = 240
- Width = 495
- End
- Begin VB.Label Label14
- Caption = "Time 1:"
- Height = 255
- Left = 120
- TabIndex = 42
- Top = 240
- Width = 615
- End
- Begin VB.Label Label13
- Caption = "Time 2:"
- Height = 255
- Left = 1800
- TabIndex = 41
- Top = 240
- Width = 615
- End
- Begin VB.Label Label12
- Caption = "Result:"
- Height = 255
- Left = 4080
- TabIndex = 40
- Top = 240
- Width = 615
- End
- End
- Begin VB.Frame fraTimePlusTime
- Caption = "Method TimePlusTime"
- Height = 735
- Left = 120
- TabIndex = 27
- Top = 120
- Width = 6255
- Begin VB.CommandButton cmdTimePlusTime
- Caption = "Do"
- Height = 375
- Left = 3480
- TabIndex = 31
- Top = 240
- Width = 495
- End
- Begin VB.TextBox txtTimePlusTimeResult
- Height = 285
- Left = 4680
- TabIndex = 30
- Text = "Text1"
- Top = 240
- Width = 735
- End
- Begin VB.TextBox txtTimeForTimePlusTime2
- Height = 285
- Left = 2400
- TabIndex = 29
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtTimeForTimePlusTime1
- Height = 285
- Left = 720
- TabIndex = 28
- Text = "Text1"
- Top = 240
- Width = 855
- End
- Begin VB.Label Label11
- Caption = "Result:"
- Height = 255
- Left = 4080
- TabIndex = 34
- Top = 240
- Width = 615
- End
- Begin VB.Label Label10
- Caption = "Time 2:"
- Height = 255
- Left = 1800
- TabIndex = 33
- Top = 240
- Width = 615
- End
- Begin VB.Label Label9
- Caption = "Time 1:"
- Height = 255
- Left = 120
- TabIndex = 32
- Top = 240
- Width = 615
- End
- End
- End
- Begin SNAILTIMECALCLibCtl.SNTimeCalc SNTimeCalc1
- Left = 6120
- OleObjectBlob = "Form1.frx":0000
- Top = 0
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdDateMeth1_Click()
- cmdDateMeth1.Enabled = False
- picDateMeth1.Enabled = True
- picDateMeth1.Visible = True
- cmdTimeMeth1.Enabled = True
- picTimeMeth1.Enabled = False
- picTimeMeth1.Visible = False
- End Sub
- Private Sub cmdDatePlusDays_Click()
- On Error GoTo cmdDatePlusDays_Click_Err
- txtResultDateForDatePlusDays.Text = SNTimeCalc1.DatePlusDays(txtDateForDatePlusDays.Text, txtDaysForDatePlusDays.Text)
- Exit Sub
- cmdDatePlusDays_Click_Err:
- MsgBox Err.Description
- End Sub
- Private Sub cmdDayOfWeek_Click()
- On Error GoTo cmdDayOfWeek_Click_Err
- txtDayOfWeekNumber.Text = SNTimeCalc1.DayOfWeek(txtDateForDayOfWeek.Text)
- txtDayOfWeekVerbose.Text = DayOfWeekString(CInt(txtDayOfWeekNumber.Text))
- Exit Sub
- cmdDayOfWeek_Click_Err:
- MsgBox Err.Description
- End Sub
- Private Sub cmdDaysBetweenDates_Click()
- On Error GoTo cmdDaysBetweenDates_Click_Err
- txtResultDays.Text = SNTimeCalc1.DaysBetweenDates(txtDateForDaysBetweenDays1.Text, txtDateForDaysBetweenDays2.Text)
- Exit Sub
- cmdDaysBetweenDates_Click_Err:
- MsgBox Err.Description
- End Sub
- Private Sub cmdTimeMeth1_Click()
- cmdDateMeth1.Enabled = True
- picDateMeth1.Enabled = False
- picDateMeth1.Visible = False
- cmdTimeMeth1.Enabled = False
- picTimeMeth1.Enabled = True
- picTimeMeth1.Visible = True
- End Sub
- Private Sub cmdTimeMinusTime_Click()
- On Error GoTo cmdTimeMinusTime_Click_Err
- txtTimeMinusTimeResult.Text = SNTimeCalc1.TimeMinusTime(txtTimeForTimeMinusTime1.Text, txtTimeForTimeMinusTime2.Text)
- Exit Sub
- cmdTimeMinusTime_Click_Err:
- MsgBox Err.Description
- End Sub
- Private Sub cmdTimePlusTime_Click()
- On Error GoTo cmdTimePlusTime_Click_Err
- txtTimePlusTimeResult.Text = SNTimeCalc1.TimePlusTime(txtTimeForTimePlusTime1.Text, txtTimeForTimePlusTime2.Text)
- Exit Sub
- cmdTimePlusTime_Click_Err:
- MsgBox Err.Description
- End Sub
- Private Sub Form_Load()
- 'Initialize windows
- cmdDateMeth1.Enabled = False
- picDateMeth1.Enabled = True
- picDateMeth1.Visible = True
- cmdTimeMeth1.Enabled = True
- picTimeMeth1.Enabled = False
- picTimeMeth1.Visible = False
- 'Initialize fields
- 'DatePlusDays
- txtDateForDatePlusDays.Text = Date
- txtDaysForDatePlusDays.Text = "0"
- txtResultDateForDatePlusDays.Text = SNTimeCalc1.DatePlusDays(txtDateForDatePlusDays.Text, txtDaysForDatePlusDays.Text)
- 'DaysBetweenDates
- txtDateForDaysBetweenDays1.Text = Date
- txtDateForDaysBetweenDays2.Text = Date
- txtResultDays.Text = SNTimeCalc1.DaysBetweenDates(txtDateForDaysBetweenDays1.Text, txtDateForDaysBetweenDays2.Text)
- 'Day of week
- txtDateForDayOfWeek.Text = Date
- txtDayOfWeekNumber.Text = SNTimeCalc1.DayOfWeek(txtDateForDayOfWeek.Text)
- txtDayOfWeekVerbose.Text = DayOfWeekString(CInt(txtDayOfWeekNumber.Text))
- 'TimePlusTime
- txtTimeForTimePlusTime1.Text = Time
- txtTimeForTimePlusTime2.Text = Time
- txtTimePlusTimeResult.Text = SNTimeCalc1.TimePlusTime(txtTimeForTimePlusTime1.Text, txtTimeForTimePlusTime2.Text)
- 'TimeMinusTime
- txtTimeForTimeMinusTime1.Text = Time
- txtTimeForTimeMinusTime2.Text = Time
- txtTimeMinusTimeResult.Text = SNTimeCalc1.TimeMinusTime(txtTimeForTimeMinusTime1.Text, txtTimeForTimeMinusTime2.Text)
- End Sub
- Private Function DayOfWeekString(nDayOfWeek As Integer) As String
- Select Case nDayOfWeek
- Case 0
- DayOfWeekString = "Sunday"
- Case 1
- DayOfWeekString = "Monday"
- Case 2
- DayOfWeekString = "Tuesday"
- Case 3
- DayOfWeekString = "Wednesday"
- Case 4
- DayOfWeekString = "Thursday"
- Case 5
- DayOfWeekString = "Friday"
- Case 6
- DayOfWeekString = "Saturday"
- End Select
- End Function
-